package com.zhsj.OkeHomeConsumption.ui.activity;

import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.View;

import com.flyco.tablayout.SlidingTabLayout;
import com.hjq.bar.OnTitleBarListener;
import com.hjq.bar.TitleBar;
import com.hjq.base.BaseActivity;
import com.zhsj.OkeHomeConsumption.R;
import com.zhsj.OkeHomeConsumption.ui.fragment.BaiMemberFragment;
import com.zhsj.OkeHomeConsumption.ui.fragment.InvateMemberFragment;
import com.zhsj.OkeHomeConsumption.ui.fragment.ShareMemberFragment;

import java.util.ArrayList;

public class InvitePActivity extends BaseActivity {

    private TitleBar tb_copy_title;
    private SlidingTabLayout tablayout;
    private ViewPager viper;
    private ArrayList<Fragment> mFragments;


    @Override
    protected int getLayoutId() {
        return R.layout.activity_invite_p;
    }

    @Override
    protected int getTitleId() {
        return R.id.tb_copy_title;
    }

    protected void initView() {
        tb_copy_title = (TitleBar) findViewById(R.id.tb_copy_title);
        tablayout = (SlidingTabLayout) findViewById(R.id.tablayout);
        viper = (ViewPager) findViewById(R.id.viper);

        mFragments = new ArrayList<>();
        mFragments.add(new ShareMemberFragment());  //分享会员
        mFragments.add(new InvateMemberFragment()); //邀请会员
        mFragments.add(new BaiMemberFragment());    //百问百答

        tablayout.setViewPager(viper, new String[]{"分享体验", "邀请会员", "百问百答"}, this, mFragments);
        tb_copy_title.setOnTitleBarListener(new OnTitleBarListener() {
            @Override
            public void onLeftClick(View v) {
                finish();
            }

            @Override
            public void onTitleClick(View v) {

            }

            @Override
            public void onRightClick(View v) {

            }
        });
    }

    @Override
    protected void initData() {

    }
}
